package com.cpp.common.enums;

import lombok.Getter;

@Getter
public enum UserRoleEnum {
    // 管理员
    ADMIN("0", "管理员"),
    // 老师
    TEACHER("1","老师"),
    // 学生
    STUDENT("2","学生");


    private final String role;

    private String desc;

    UserRoleEnum(String role, String desc) {
        this.role = role;
        this.desc = desc;
    }

    public static UserRoleEnum getType(String role) {
        for (UserRoleEnum value : UserRoleEnum.values()) {
            if (value.getRole().equals(role)) {
                return value;
            }
        }
        return null;
    }
}
